#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([zad1lab5], [1.0a], [])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/zad1.c])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_MACRO_DIR([m4])
LT_INIT

# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADERS([stdlib.h unistd.h])

AC_ARG_WITH(handler,
    AC_HELP_STRING([with-handler], [ustala handler sygnałów]),
    [                                                           
	echo "Wybrany handler: "
	if test "$with_handler" = "SIGNAL" ; then
		AC_DEFINE([SIGNAL],[],[handler signal])
		AC_MSG_RESULT([SIGNAL])
	else if test "$with_handler" = "SIGNALACT"; then
		AC_DEFINE([SIGNALACT],[],[handler signalact])
		AC_MSG_RESULT([SIGNALACT])
	else
		AC_MSG_ERROR([Musisz wybrać handler sygnałów (signal, signalact)])
	fi
	fi
    ],[])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T

# Checks for library functions.
AC_FUNC_FORK

AC_CONFIG_FILES([Makefile
                 src/Makefile])
AC_OUTPUT
